Socket
Socket
Sign inDemoInstall

@hig/spacer

Package Overview
Dependencies
Maintainers
6
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@hig/spacer

HIG Spacer component


Version published
Weekly downloads
17
decreased by-15%
Maintainers
6
Weekly downloads
 
Created
Source

Spacer

The Spacer component renders a square of empty space, meant to add space around and in other components.

Getting started

yarn add @hig/spacer @hig/theme-context @hig/theme-data

Import the component

import Spacer from '@hig/spacer';

Basic usage

<Spacer spacing="xl"/>

Styling

Use the className prop to pass in a css class name to the outermost container of the component. The class name will also pass down to most of the other styled elements within the component.

Spacer also has a stylesheet prop that accepts a function wherein you can modify its styles. For instance

import Spacer from '@hig/spacer';

function YourComponent() {
  // ...
  const customStylesheet = (styles, props, themeData) => ({
    ...styles,
    spacer: {
      ...styles.spacer,
      color: themeData["colorScheme.status.error"]
    }
  });

  return (
    <Spacer stylesheet={customStylesheet} />
  );
}

FAQs

Package last updated on 28 Aug 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc